package com.koron.ticket.operation.service.imp;

import com.koron.ticket.operation.bean.WTicketSecuritySteps;
import com.koron.ticket.operation.mapper.WTicketSecurityStepsMapper;
import com.koron.ticket.operation.service.WTicketSecurityStepsService;
import org.koron.ebs.mybatis.SessionFactory;
import org.koron.ebs.mybatis.TaskAnnotation;
import org.springframework.stereotype.Service;

/**
 * 安全防误操作票操作详情(WTicketSecuritySteps)表服务实现类
 *
 * @author makejava
 * @since 2023-06-25 09:24:17
 */
@Service
public class WTicketSecurityStepsServiceImpl implements WTicketSecurityStepsService {

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    @TaskAnnotation("queryById")
    public WTicketSecuritySteps queryById(SessionFactory factory, String id) {
        return factory.getMapper(WTicketSecurityStepsMapper.class).queryById(id);
    }

    /**
     * 新增数据
     *
     * @param wTicketSecuritySteps 实例对象
     * @return 实例对象
     */
    @Override
    @TaskAnnotation("insert")
    public int insert(SessionFactory factory,WTicketSecuritySteps wTicketSecuritySteps) {
        return factory.getMapper(WTicketSecurityStepsMapper.class).insert(wTicketSecuritySteps);
    }

    /**
     * 修改数据
     *
     * @param wTicketSecuritySteps 实例对象
     * @return 实例对象
     */
    @Override
    @TaskAnnotation("update")
    public int update(SessionFactory factory,WTicketSecuritySteps wTicketSecuritySteps) {
        return factory.getMapper(WTicketSecurityStepsMapper.class).update(wTicketSecuritySteps);
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    @TaskAnnotation("deleteById")
    public int deleteById(SessionFactory factory,String id) {
        return factory.getMapper(WTicketSecurityStepsMapper.class).deleteById(id);
    }
}
